#ifndef _DATA_HANDLER_H
#define _DATA_HANDLER_H

#define LINE_SIZE 		200
#define DATABASE_NAME 	"database.dat"

#define MOVIE_NOT_FOUND "*** Filme não encontrado ***"
#define OPT_ERROR "*** Opção não implementada!!! ***"

typedef struct Movie {
	int 	id;
	char* 	title;
	char* 	sinopse;
	char* 	room;
	char* 	hours;
	float 	rate;
	int 	clients;
	int 	valid;
} Movie;

typedef Movie* MoviesList;

typedef struct Request {
	int option;
	int value;
	int rate;
} Request;


/* Find the file wich contains database informations. */
FILE* findDataSource(char* fileName);

/* Get movies from database. */
MoviesList getMovies(FILE* fp);

/* Initialize the data handler. */
void initDataHandler();

/*  Get id and title of all movies. */
char* getNumberMoviesList();

/*  Get all info about the movies. */
char* getAllInfoMoviesList();

/*  Get id and title of all movies. */
char* getSinopseMovie(int id);

/*  Get id and title of all movies. */
char* getAllInfoMovie(int id);

/* Get id and title of all movies. */
char* getMediumMovie(int id);

/* Set the rate of movie. */
char* setRateMovie(Request req);

#endif
